@extends("layouts.common")
@section('page-content-wrapper')

    <style>
        .categories-group-list a {
            color: #343a40;
        }
    </style>
    <div class="table-rep-plugin">
        <div class="btn-toolbar">
            <div class="button-items btn-group">

            </div>
            <div class="search-bar btn-group pull-right">
                <a href="javascript:" id="release" class="mx-1 btn btn-success waves-effect waves-light">发布菜单</a>
            </div>
        </div>
        <div class="border p-3 rounded mt-4">
            <div id="sortList" class="custom-accordion categories-accordion">

            </div>
        </div>
    </div>
@endsection
@section('extend-javascript')
    <script>
        myAdmin.sortList({
            table_elem: '#currentTable',
            index_url: '/mp/admin/mp_menu/{{request()->route()->parameter('id')}}',
            add_url: '/mp/admin/mp_menu/{{request()->route()->parameter('id')}}/create',
            edit_url: '/mp/admin/mp_menu/{{request()->route()->parameter('id')}}/edit',
            delete_url: '/mp/admin/mp_menu/destroy',
            sort_url: '/mp/admin/mp_menu/{{request()->route()->parameter('id')}}/sort',
        });

        $('#release').click(function () {
            myAdmin.request.post("/mp/admin/mp_menu/release", {mp_id: {{request()->route()->parameter('id')}}}, function (response) {
                myAdmin.message.success(response.msg);
            });
        });
    </script>
@endsection
